package com.stack.apis.wemedia;

import com.stack.apis.article.fallback.IArticleClientFallback;
import com.stack.apis.wemedia.fallback.IWemediaClientFallback;
import com.stack.model.common.dtos.ResponseResult;
import com.stack.model.user.pojos.ApUser;
import com.stack.model.wemedia.NewsIdVO;
import com.stack.model.wemedia.dtos.WmNewsPageReqDto;
import com.stack.model.wemedia.pojos.WmChannel;
import com.stack.model.wemedia.pojos.WmNews;
import com.stack.model.wemedia.pojos.WmUser;
import org.springframework.beans.BeanUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-wemedia",fallback = IWemediaClientFallback.class)
public interface IWemediaClient {

    /**
     * channel
     */

    @GetMapping("/api/v1/channel/list")
    ResponseResult getChannels();

    @GetMapping("/api/v1/channel/{id}")
    WmChannel getChannelBase(@PathVariable("id") Integer id);

    @PostMapping("/api/v1/channel/save")
    Boolean saveChannel(@RequestBody WmChannel wmChannel);

    @PostMapping("/api/v1/channel/updateChannel")
    void updateChannel(@RequestBody WmChannel wmChannel);

    /**
     * user
     */

    @GetMapping("/api/v1/user/getUserBase")
    WmUser getUserBase(Integer id);

    /**
     *news
     */

    @PostMapping("/api/v1/news/updateNewsById")
    Boolean updateNewsById(@RequestBody WmNews wmNews);

    @PostMapping("/api/v1/news/getNewsList")
    ResponseResult getNewsList(@RequestBody WmNewsPageReqDto dto);

    @GetMapping("/api/v1/news/saveApArticleAndWmNews")
    void saveApArticleAndWmNews(@RequestBody NewsIdVO dto);


}
